From a9a7526ed8c9cbb87d91b9a6f719ba3c52bef9c7 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Mon, 15 Jul 2013 16:37:02 +0000 Subject: [PATCH] More splitting of testo cases. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4435 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/testo.d/an1.test | 20 ++++++ gpsbabel/testo.d/bcr.test | 11 ++++ gpsbabel/testo.d/classic-1.test | 99 ----------------------------- gpsbabel/testo.d/classic-2.test | 78 ----------------------- gpsbabel/testo.d/classic-3.test | 32 ---------- gpsbabel/testo.d/classic-4.test | 26 -------- gpsbabel/testo.d/dmtlog.test | 8 +++ gpsbabel/testo.d/enigma.test | 8 +++ gpsbabel/testo.d/gpspilot.test | 9 +++ gpsbabel/testo.d/holux.test | 8 +++ gpsbabel/testo.d/hsandv.test | 12 ++++ gpsbabel/testo.d/magellan_sd.test | 8 +++ gpsbabel/testo.d/mapsend.test | 17 +++++ gpsbabel/testo.d/mapsource.test | 41 ++++++++++++ gpsbabel/testo.d/msroute.test | 6 ++ gpsbabel/testo.d/route_reverse.test | 26 ++++++++ gpsbabel/testo.d/stackfilter.test | 9 +++ gpsbabel/testo.d/stmsdf.test | 11 ++++ gpsbabel/testo.d/tpg.test | 11 ++++ gpsbabel/testo.d/unicsv_grids.test | 17 +++++ gpsbabel/testo.d/xmapwpt.test | 6 ++ 21 files changed, 228 insertions(+), 235 deletions(-) create mode 100644 gpsbabel/testo.d/an1.test create mode 100644 gpsbabel/testo.d/bcr.test create mode 100644 gpsbabel/testo.d/dmtlog.test create mode 100644 gpsbabel/testo.d/enigma.test create mode 100644 gpsbabel/testo.d/gpspilot.test create mode 100644 gpsbabel/testo.d/holux.test create mode 100644 gpsbabel/testo.d/hsandv.test create mode 100644 gpsbabel/testo.d/magellan_sd.test create mode 100644 gpsbabel/testo.d/mapsource.test create mode 100644 gpsbabel/testo.d/msroute.test create mode 100644 gpsbabel/testo.d/route_reverse.test create mode 100644 gpsbabel/testo.d/stackfilter.test create mode 100644 gpsbabel/testo.d/stmsdf.test create mode 100644 gpsbabel/testo.d/tpg.test create mode 100644 gpsbabel/testo.d/unicsv_grids.test create mode 100644 gpsbabel/testo.d/xmapwpt.test diff --git a/gpsbabel/testo.d/an1.test b/gpsbabel/testo.d/an1.test new file mode 100644 index 000000000..5e82bd7e6 --- /dev/null +++ b/gpsbabel/testo.d/an1.test @@ -0,0 +1,20 @@ + +# +# DeLorme .an1 tests +# +rm -f ${TMPDIR}/an1.out +gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o csv -F ${TMPDIR}/an1.out +compare ${REFERENCE}/an1-in.ref ${TMPDIR}/an1.out + +rm -f ${TMPDIR}/an1.out +gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o an1 -F ${TMPDIR}/an1.out +bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-an1.ref + +rm -f ${TMPDIR}/an1.out +gpsbabel -i xmap -f ${REFERENCE}/xmap -o an1 -F ${TMPDIR}/an1.out +bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-out.ref + +rm -f ${TMPDIR}/an1.out +gpsbabel -i google -f ${REFERENCE}/google.js -o an1 -F ${TMPDIR}/an1.out +bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-line-out.ref + diff --git a/gpsbabel/testo.d/bcr.test b/gpsbabel/testo.d/bcr.test new file mode 100644 index 000000000..3950e48ad --- /dev/null +++ b/gpsbabel/testo.d/bcr.test @@ -0,0 +1,11 @@ +# +# Map&Guide Motorrad Routenplaner .bcr files test +# +rm -f ${TMPDIR}/bcr* +gpsbabel -r -i bcr -f ${REFERENCE}/route/bcr-sample.bcr -o gpx -F ${TMPDIR}/bcr-sample.gpx +compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample.gpx +gpsbabel -r -i gpx -f ${REFERENCE}/route/bcr-sample.gpx -o bcr -F ${TMPDIR}/bcr-sample2.bcr +compare ${REFERENCE}/route/bcr-sample2.bcr ${TMPDIR}/bcr-sample2.bcr +gpsbabel -r -i bcr -f ${TMPDIR}/bcr-sample2.bcr -o gpx -F ${TMPDIR}/bcr-sample2.gpx +compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample2.gpx + diff --git a/gpsbabel/testo.d/classic-1.test b/gpsbabel/testo.d/classic-1.test index a473772ea..1eb1ea028 100644 --- a/gpsbabel/testo.d/classic-1.test +++ b/gpsbabel/testo.d/classic-1.test @@ -4,89 +4,6 @@ # Magellan serial # TODO -# TPG (NG Topo!) file format -# This is hard to test as the datum conversions create minute -# inconsistencies in the coordinates. So.. we test our i/o -# against a format that rounds higher than we care to compare -# for binary data. -rm -f ${TMPDIR}/topo.mxf ${TMPDIR}/tpg.mxf ${TMPDIR}/geo.tpg -gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o tpg -F ${TMPDIR}/geo.tpg -gpsbabel -i tpg -f ${TMPDIR}/geo.tpg -o mxf -F ${TMPDIR}/tpg.mxf -gpsbabel -i tpg -f ${REFERENCE}/tpg.tpg -o mxf -F ${TMPDIR}/topo.mxf -compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf - -# Holux support is a little funky to test. Becuase it loses precision, -# if we convert it to another format, we lose accuracy (rounding) in the -# coords, so converting it so something else and comparing it never works. -# So we verify that we can read the reference and write it and get an -# identical reference. -gpsbabel -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo -# compare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo - -# GPSPilot Tracker for PalmOS -# This test is eerily similar to the NAV Companion test. In fact, the -# converted reference file (magnavr.gpu) is identical. -rm -f ${TMPDIR}/gpspilot.pdb ${TMPDIR}/gpspilot.gpu ${TMPDIR}/gpspil_t.gpu -gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o gpspilot -F ${TMPDIR}/gpspilot.pdb -gpsbabel -i gpspilot -f ${TMPDIR}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspilot.gpu -gpsbabel -i gpspilot -f ${REFERENCE}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspil_t.gpu -compare ${TMPDIR}/gpspil_t.gpu ${TMPDIR}/gpspilot.gpu -compare ${REFERENCE}/gu.wpt ${TMPDIR}/gpspilot.gpu - -# XMapHH Street Atlas USA file format -rm -f ${TMPDIR}/xmapwpt.wpt ${TMPDIR}/xmapwpt.xmapwpt -gpsbabel -i xmapwpt -f ${REFERENCE}/xmapwpt.wpt -o xmapwpt -F ${TMPDIR}/xmapwpt.xmapwpt -gpsbabel -i xmapwpt -f ${TMPDIR}/xmapwpt.xmapwpt -o xmapwpt -F ${TMPDIR}/xmapwpt.wpt -compare ${TMPDIR}/xmapwpt.wpt ${REFERENCE} - -# Garmin Mapsource This is a binary format with some undocumented -# fields. This test is therefore intentionally vague. We read a file, -# convert it to GPX, then write a file as MPS, then read it back and -# write it as GPX and compare them. Since we're writing both GPX files -# ourselves from the same version, we're immune to changes in our own -# GPX output. - -rm -fr ${TMPDIR}/ms.gpx ${TMPDIR}/ms[12].gpx -gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o gpx -F ${TMPDIR}/ms1.gpx -gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o mapsource -F ${TMPDIR}/ms.mps -gpsbabel -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx -compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx - -# -# MRCB mapsource track test -# -rm -f ${TMPDIR}/mps-track.mps -gpsbabel -t -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \ - -F ${TMPDIR}/mps-track.mps -compare ${TMPDIR}/mps-track.mps ${REFERENCE}/track - -# Now do a test of reading waypoints from a track-only file - should have an empty result -rm -f ${TMPDIR}/mps-track.mps -gpsbabel -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \ - -F ${TMPDIR}/mps-track.mps -compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-track.mps - -# -# MRCB mapsource route test -# -rm -f ${TMPDIR}/mps-route.mps -gpsbabel -r -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=4 \ - -F ${TMPDIR}/mps-route.mps -compare ${REFERENCE}/route/route.mps ${TMPDIR}/mps-route.mps - -# Now do a test of reading tracks from a route-only file - should have an empty result -rm -f ${TMPDIR}/mps-route.mps -gpsbabel -t -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=3 \ - -F ${TMPDIR}/mps-route.mps -compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-route.mps -# -# magellan SD card waypoint / route format -# -rm -f ${TMPDIR}/magellan.rte -gpsbabel -r -i magellan -f ${REFERENCE}/route/magellan.rte -o magellan \ - -F ${TMPDIR}/magellan.rte -compare ${REFERENCE}/route/magellan.rte ${TMPDIR}/magellan.rte - # # GPX routes -- since GPX contains a date stamp, tests will always @@ -110,19 +27,3 @@ gpsbabel -t -i magellan -f ${REFERENCE}/track/meridian.trk -o gpx \ -F ${TMPDIR}/maggpx.trk compare ${TMPDIR}/maggpx.trk ${TMPDIR}/gpxtrack.gpx -# -# MAPSEND waypoint / route format -# -rm -f ${TMPDIR}/route.mapsend -gpsbabel -r -i mapsend -f ${REFERENCE}/route/route.mapsend -o mapsend \ - -F ${TMPDIR}/route.mapsend -bincompare ${TMPDIR}/route.mapsend ${REFERENCE}/route/route.mapsend - -# -# MAPSEND track format -# -rm -f ${TMPDIR}/mapsend.trk -gpsbabel -t -i mapsend -f ${REFERENCE}/track/mapsend.trk -o mapsend,trkver=3 \ - -F ${TMPDIR}/mapsend.trk -compare ${TMPDIR}/mapsend.trk ${REFERENCE}/track/ - diff --git a/gpsbabel/testo.d/classic-2.test b/gpsbabel/testo.d/classic-2.test index 424b14d01..207da68ee 100644 --- a/gpsbabel/testo.d/classic-2.test +++ b/gpsbabel/testo.d/classic-2.test @@ -1,50 +1,4 @@ #!/bin/sh -# -# Route reversal filter. Do it twice and be sure we get what we -# started with. -# -rm -f ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc ${TMPDIR}/reference.arc -gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ - -o arc -F ${TMPDIR}/reference.arc -gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ - -x reverse \ - -o arc -F ${TMPDIR}/reverse1.arc -gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ - -x reverse \ - -x reverse \ - -o arc -F ${TMPDIR}/reverse2.arc -# Verify the first and last are the same -compare ${TMPDIR}/reference.arc ${TMPDIR}/reverse2.arc -# Verify the first and second are different. -#${DIFF} ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc > /dev/null && { -# echo ERROR Failed reversal test. -# exit 1 -#} - -# parkrrrr: This isn't a straightforward compare; we *want* it to fail. -# Obviously this test should just be rewritten with a new reference. -#compare ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc - - -# -# DeLorme .an1 tests -# -rm -f ${TMPDIR}/an1.out -gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o csv -F ${TMPDIR}/an1.out -compare ${REFERENCE}/an1-in.ref ${TMPDIR}/an1.out - -rm -f ${TMPDIR}/an1.out -gpsbabel -i an1 -f ${REFERENCE}/foo.an1 -o an1 -F ${TMPDIR}/an1.out -bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-an1.ref - -rm -f ${TMPDIR}/an1.out -gpsbabel -i xmap -f ${REFERENCE}/xmap -o an1 -F ${TMPDIR}/an1.out -bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-out.ref - -rm -f ${TMPDIR}/an1.out -gpsbabel -i google -f ${REFERENCE}/google.js -o an1 -F ${TMPDIR}/an1.out -bincompare ${TMPDIR}/an1.out ${REFERENCE}/an1-line-out.ref - # # XCSV "human readable" tests @@ -64,27 +18,6 @@ rm -f ${TMPDIR}/pathdist.out gpsbabel -i magellan -f ${REFERENCE}/dusky.trk -o xcsv,style=${REFERENCE}/gnuplot.style -F ${TMPDIR}/pathdist.out compare ${REFERENCE}/dusky.gnuplot ${TMPDIR}/pathdist.out -# hsandv -rm -f ${TMPDIR}/hsandv.exp ${TMPDIR}/1.exp ${TMPDIR}/1.exp ${TMPDIR}/Glad_5.exp -gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o hsandv -F ${TMPDIR}/hsandv.exp -compare ${TMPDIR}/hsandv.exp ${REFERENCE} -#the hsandv format is too lossy to do this test :( -#gpsbabel -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp -#gpsbabel -i hsandv -f ${REFERENCE}/hsandv.exp -o geo -F ${TMPDIR}/2.exp -#compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp -#test conversion from v4 to v5 files -gpsbabel -i hsandv -f ${REFERENCE}/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp -# FIXME: Can't compare directly because of potential FP rounding. -# FIXME: compare ${TMPDIR}/Glad_5.exp reference - -# -# stack filter tests -# These don't actually test for proper behavior, for now, but they do -# exercise all of the currently-extant filter code. -# - -gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt - # # 'tabsep' isn't really tested in any non-trivial way, but we do exercise # it. @@ -108,14 +41,3 @@ gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o geo -F ${TMPDIR}/geocustom # gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out -# -# Map&Guide Motorrad Routenplaner .bcr files test -# -rm -f ${TMPDIR}/bcr* -gpsbabel -r -i bcr -f ${REFERENCE}/route/bcr-sample.bcr -o gpx -F ${TMPDIR}/bcr-sample.gpx -compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample.gpx -gpsbabel -r -i gpx -f ${REFERENCE}/route/bcr-sample.gpx -o bcr -F ${TMPDIR}/bcr-sample2.bcr -compare ${REFERENCE}/route/bcr-sample2.bcr ${TMPDIR}/bcr-sample2.bcr -gpsbabel -r -i bcr -f ${TMPDIR}/bcr-sample2.bcr -o gpx -F ${TMPDIR}/bcr-sample2.gpx -compare ${REFERENCE}/route/bcr-sample.gpx ${TMPDIR}/bcr-sample2.gpx - diff --git a/gpsbabel/testo.d/classic-3.test b/gpsbabel/testo.d/classic-3.test index 098d73b36..1e09fb58b 100644 --- a/gpsbabel/testo.d/classic-3.test +++ b/gpsbabel/testo.d/classic-3.test @@ -6,12 +6,6 @@ gpsbabel -i ignrando -f ${REFERENCE}/track/ignrando-sample.rdn -o ignrando -F ${TMPDIR}/ignrando-sample.rdn gpsbabel -i ignrando -f ${TMPDIR}/ignrando-sample.rdn -o gpx -F ${TMPDIR}/ignrando-sample.gpx compare ${REFERENCE}/track/ignrando-sample.gpx ${TMPDIR}/ignrando-sample.gpx -# -# Microsoft AutoRoute 2002 test (read-only) -# -gpsbabel -i msroute -f ${REFERENCE}/route/msroute-sample.axe -o gpx -F ${TMPDIR}/msroute-sample.gpx -compare ${REFERENCE}/route/msroute-sample.gpx ${TMPDIR}/msroute-sample.gpx - # # Testing the 'nuketypes' filter is funky. @@ -44,25 +38,6 @@ gpsbabel -t -w -i wbt-bin -f ${REFERENCE}/wbt-201.tk1 -o gpx -F ${TMPDIR}/wbt-20 grep -v time <${TMPDIR}/wbt-201.gpx >${TMPDIR}/wbt-201.gpx2 compare ${REFERENCE}/wbt-201.gpx ${TMPDIR}/wbt-201.gpx2 - -# -# Suunto SDF -# -rm -f ${TMPDIR}/stmsdf* -gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -t -o stmsdf -F ${TMPDIR}/stmsdf-track.sdf -r -o stmsdf,index=2 -F ${TMPDIR}/stmsdf-route.sdf -compare ${REFERENCE}/track/stmsdf-track.sdf ${TMPDIR}/stmsdf-track.sdf -compare ${REFERENCE}/route/stmsdf-route.sdf ${TMPDIR}/stmsdf-route.sdf -gpsbabel -i stmsdf -f ${TMPDIR}/stmsdf-track.sdf -f ${TMPDIR}/stmsdf-route.sdf -o garmin_txt,prec=2 -F ${TMPDIR}/stmsdf.txt -compare ${REFERENCE}/stmsdf.txt ${TMPDIR}/stmsdf.txt - -# -# Digital Mapping Tracklogs -# -rm -f ${TMPDIR}/dmtlog* -gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl -gpsbabel -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx -compare ${REFERENCE}/track/dmtlog-sample.gpx ${TMPDIR}/dmtlog-sample.gpx - # # gzipped file i/o # @@ -77,10 +52,3 @@ compare ${REFERENCE}/route/cst-sample.gpx ${TMPDIR}/cst-sample.gpx gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -x nuketypes,routes,tracks -x transform,rte=wpt,del=y -o gpx -F ${TMPDIR}/transform-ver.gpx compare ${REFERENCE}/transform-rte.gpx ${TMPDIR}/transform-ver.gpx -# -# VITO SmartMap .vtt track file 'vitovtt' test -# -rm -f ${TMPDIR}/vitovtt-* -gpsbabel -i vitovtt -f ${REFERENCE}/track/vitovtt-sample.vtt -o gpx -F ${TMPDIR}/vitovtt-sample.gpx -compare ${REFERENCE}/track/vitovtt-sample.gpx ${TMPDIR}/vitovtt-sample.gpx - diff --git a/gpsbabel/testo.d/classic-4.test b/gpsbabel/testo.d/classic-4.test index f62cd4702..e69de29bb 100644 --- a/gpsbabel/testo.d/classic-4.test +++ b/gpsbabel/testo.d/classic-4.test @@ -1,26 +0,0 @@ -#!/bin/sh -# -# unicsv with various grids -# -gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-swiss.csv -o gpx -F ${TMPDIR}/grid-swiss~csv.gpx -compare ${REFERENCE}/grid-swiss~csv.gpx ${TMPDIR}/grid-swiss~csv.gpx -gpsbabel -i gpx -f ${REFERENCE}/grid-swiss~csv.gpx -o unicsv,utc=0,grid=swiss -F ${TMPDIR}/grid-swiss.csv -compare ${REFERENCE}/grid-swiss.csv ${TMPDIR}/grid-swiss.csv - -gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-bng.csv -o gpx -F ${TMPDIR}/grid-bng~csv.gpx -compare ${REFERENCE}/grid-bng~csv.gpx ${TMPDIR}/grid-bng~csv.gpx -gpsbabel -i gpx -f ${REFERENCE}/grid-bng~csv.gpx -o unicsv,utc=0,grid=bng -F ${TMPDIR}/grid-bng.csv -compare ${REFERENCE}/grid-bng.csv ${TMPDIR}/grid-bng.csv - -gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-utm.csv -o gpx -F ${TMPDIR}/grid-utm~csv.gpx -compare ${REFERENCE}/grid-utm~csv.gpx ${TMPDIR}/grid-utm~csv.gpx -gpsbabel -i gpx -f ${REFERENCE}/grid-utm~csv.gpx -o unicsv,utc=0,grid=utm -F ${TMPDIR}/grid-utm.csv -compare ${REFERENCE}/grid-utm.csv ${TMPDIR}/grid-utm.csv - -# -# MGL Enigma route file (.ert) -# -gpsbabel -i gpx -f ${REFERENCE}/enigma.gpx -o enigma -F ${TMPDIR}/enigma.ert -compare ${REFERENCE}/enigma-gpsb.ert ${TMPDIR}/enigma.ert -gpsbabel -i enigma -f ${REFERENCE}/enigma-pfms.ert -o gpx -F ${TMPDIR}/enigma.gpx -compare ${REFERENCE}/enigma.gpx ${TMPDIR}/enigma.gpx diff --git a/gpsbabel/testo.d/dmtlog.test b/gpsbabel/testo.d/dmtlog.test new file mode 100644 index 000000000..e19077cf6 --- /dev/null +++ b/gpsbabel/testo.d/dmtlog.test @@ -0,0 +1,8 @@ +# +# Digital Mapping Tracklogs +# +rm -f ${TMPDIR}/dmtlog* +gpsbabel -i gpx -f ${REFERENCE}/expertgps.gpx -o dmtlog -F ${TMPDIR}/dmtlog-sample.trl +gpsbabel -i dmtlog -f ${TMPDIR}/dmtlog-sample.trl -o gpx -F ${TMPDIR}/dmtlog-sample.gpx +compare ${REFERENCE}/track/dmtlog-sample.gpx ${TMPDIR}/dmtlog-sample.gpx + diff --git a/gpsbabel/testo.d/enigma.test b/gpsbabel/testo.d/enigma.test new file mode 100644 index 000000000..3497127bd --- /dev/null +++ b/gpsbabel/testo.d/enigma.test @@ -0,0 +1,8 @@ + +# +# MGL Enigma route file (.ert) +# +gpsbabel -i gpx -f ${REFERENCE}/enigma.gpx -o enigma -F ${TMPDIR}/enigma.ert +compare ${REFERENCE}/enigma-gpsb.ert ${TMPDIR}/enigma.ert +gpsbabel -i enigma -f ${REFERENCE}/enigma-pfms.ert -o gpx -F ${TMPDIR}/enigma.gpx +compare ${REFERENCE}/enigma.gpx ${TMPDIR}/enigma.gpx diff --git a/gpsbabel/testo.d/gpspilot.test b/gpsbabel/testo.d/gpspilot.test new file mode 100644 index 000000000..09b6f2f9a --- /dev/null +++ b/gpsbabel/testo.d/gpspilot.test @@ -0,0 +1,9 @@ +# GPSPilot Tracker for PalmOS +# This test is eerily similar to the NAV Companion test. In fact, the +# converted reference file (magnavr.gpu) is identical. +rm -f ${TMPDIR}/gpspilot.pdb ${TMPDIR}/gpspilot.gpu ${TMPDIR}/gpspil_t.gpu +gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o gpspilot -F ${TMPDIR}/gpspilot.pdb +gpsbabel -i gpspilot -f ${TMPDIR}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspilot.gpu +gpsbabel -i gpspilot -f ${REFERENCE}/gpspilot.pdb -o gpsutil -F ${TMPDIR}/gpspil_t.gpu +compare ${TMPDIR}/gpspil_t.gpu ${TMPDIR}/gpspilot.gpu +compare ${REFERENCE}/gu.wpt ${TMPDIR}/gpspilot.gpu diff --git a/gpsbabel/testo.d/holux.test b/gpsbabel/testo.d/holux.test new file mode 100644 index 000000000..61e462791 --- /dev/null +++ b/gpsbabel/testo.d/holux.test @@ -0,0 +1,8 @@ + +# Holux support is a little funky to test. Becuase it loses precision, +# if we convert it to another format, we lose accuracy (rounding) in the +# coords, so converting it so something else and comparing it never works. +# So we verify that we can read the reference and write it and get an +# identical reference. +gpsbabel -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo +# compare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo diff --git a/gpsbabel/testo.d/hsandv.test b/gpsbabel/testo.d/hsandv.test new file mode 100644 index 000000000..a8b4360b3 --- /dev/null +++ b/gpsbabel/testo.d/hsandv.test @@ -0,0 +1,12 @@ +# hsandv +rm -f ${TMPDIR}/hsandv.exp ${TMPDIR}/1.exp ${TMPDIR}/1.exp ${TMPDIR}/Glad_5.exp +gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o hsandv -F ${TMPDIR}/hsandv.exp +compare ${TMPDIR}/hsandv.exp ${REFERENCE} +#the hsandv format is too lossy to do this test :( +#gpsbabel -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp +#gpsbabel -i hsandv -f ${REFERENCE}/hsandv.exp -o geo -F ${TMPDIR}/2.exp +#compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp +#test conversion from v4 to v5 files +gpsbabel -i hsandv -f ${REFERENCE}/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp +# FIXME: Can't compare directly because of potential FP rounding. +# FIXME: compare ${TMPDIR}/Glad_5.exp reference diff --git a/gpsbabel/testo.d/magellan_sd.test b/gpsbabel/testo.d/magellan_sd.test new file mode 100644 index 000000000..db472d58e --- /dev/null +++ b/gpsbabel/testo.d/magellan_sd.test @@ -0,0 +1,8 @@ +# +# magellan SD card waypoint / route format +# +rm -f ${TMPDIR}/magellan.rte +gpsbabel -r -i magellan -f ${REFERENCE}/route/magellan.rte -o magellan \ + -F ${TMPDIR}/magellan.rte +compare ${REFERENCE}/route/magellan.rte ${TMPDIR}/magellan.rte + diff --git a/gpsbabel/testo.d/mapsend.test b/gpsbabel/testo.d/mapsend.test index 35ca50052..a4a320c33 100644 --- a/gpsbabel/testo.d/mapsend.test +++ b/gpsbabel/testo.d/mapsend.test @@ -3,3 +3,20 @@ rm -f ${TMPDIR}/mm.mapsend ${TMPDIR}/mm.gps gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o mapsend -F ${TMPDIR}/mm.mapsend gpsbabel -i mapsend -f ${TMPDIR}/mm.mapsend -o gpsutil -F ${TMPDIR}/mm.gps compare ${TMPDIR}/mm.gps ${TMPDIR}/gu.wpt + +# +# MAPSEND waypoint / route format +# +rm -f ${TMPDIR}/route.mapsend +gpsbabel -r -i mapsend -f ${REFERENCE}/route/route.mapsend -o mapsend \ + -F ${TMPDIR}/route.mapsend +bincompare ${TMPDIR}/route.mapsend ${REFERENCE}/route/route.mapsend + +# +# MAPSEND track format +# +rm -f ${TMPDIR}/mapsend.trk +gpsbabel -t -i mapsend -f ${REFERENCE}/track/mapsend.trk -o mapsend,trkver=3 \ + -F ${TMPDIR}/mapsend.trk +compare ${TMPDIR}/mapsend.trk ${REFERENCE}/track/ + diff --git a/gpsbabel/testo.d/mapsource.test b/gpsbabel/testo.d/mapsource.test new file mode 100644 index 000000000..10519cf7a --- /dev/null +++ b/gpsbabel/testo.d/mapsource.test @@ -0,0 +1,41 @@ + +# Garmin Mapsource This is a binary format with some undocumented +# fields. This test is therefore intentionally vague. We read a file, +# convert it to GPX, then write a file as MPS, then read it back and +# write it as GPX and compare them. Since we're writing both GPX files +# ourselves from the same version, we're immune to changes in our own +# GPX output. + +rm -fr ${TMPDIR}/ms.gpx ${TMPDIR}/ms[12].gpx +gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o gpx -F ${TMPDIR}/ms1.gpx +gpsbabel -i mapsource -f ${REFERENCE}/mapsource.mps -o mapsource -F ${TMPDIR}/ms.mps +gpsbabel -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx +compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx + +# +# MRCB mapsource track test +# +rm -f ${TMPDIR}/mps-track.mps +gpsbabel -t -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \ + -F ${TMPDIR}/mps-track.mps +compare ${TMPDIR}/mps-track.mps ${REFERENCE}/track + +# Now do a test of reading waypoints from a track-only file - should have an empty result +rm -f ${TMPDIR}/mps-track.mps +gpsbabel -i mapsource -f ${REFERENCE}/track/mps-track.mps -o mapsource,mpsverout=3 \ + -F ${TMPDIR}/mps-track.mps +compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-track.mps + +# +# MRCB mapsource route test +# +rm -f ${TMPDIR}/mps-route.mps +gpsbabel -r -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=4 \ + -F ${TMPDIR}/mps-route.mps +compare ${REFERENCE}/route/route.mps ${TMPDIR}/mps-route.mps + +# Now do a test of reading tracks from a route-only file - should have an empty result +rm -f ${TMPDIR}/mps-route.mps +gpsbabel -t -i mapsource -f ${REFERENCE}/route/route.mps -o mapsource,mpsverout=3 \ + -F ${TMPDIR}/mps-route.mps +compare ${REFERENCE}/mps-empty.mps ${TMPDIR}/mps-route.mps diff --git a/gpsbabel/testo.d/msroute.test b/gpsbabel/testo.d/msroute.test new file mode 100644 index 000000000..4236b92f3 --- /dev/null +++ b/gpsbabel/testo.d/msroute.test @@ -0,0 +1,6 @@ +# +# Microsoft AutoRoute 2002 test (read-only) +# +gpsbabel -i msroute -f ${REFERENCE}/route/msroute-sample.axe -o gpx -F ${TMPDIR}/msroute-sample.gpx +compare ${REFERENCE}/route/msroute-sample.gpx ${TMPDIR}/msroute-sample.gpx + diff --git a/gpsbabel/testo.d/route_reverse.test b/gpsbabel/testo.d/route_reverse.test new file mode 100644 index 000000000..ee692bcbe --- /dev/null +++ b/gpsbabel/testo.d/route_reverse.test @@ -0,0 +1,26 @@ +# +# Route reversal filter. Do it twice and be sure we get what we +# started with. +# +rm -f ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc ${TMPDIR}/reference.arc +gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ + -o arc -F ${TMPDIR}/reference.arc +gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ + -x reverse \ + -o arc -F ${TMPDIR}/reverse1.arc +gpsbabel -r -i gpx -f ${REFERENCE}/route/route.gpx \ + -x reverse \ + -x reverse \ + -o arc -F ${TMPDIR}/reverse2.arc +# Verify the first and last are the same +compare ${TMPDIR}/reference.arc ${TMPDIR}/reverse2.arc +# Verify the first and second are different. +#${DIFF} ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc > /dev/null && { +# echo ERROR Failed reversal test. +# exit 1 +#} + +# parkrrrr: This isn't a straightforward compare; we *want* it to fail. +# Obviously this test should just be rewritten with a new reference. +#compare ${TMPDIR}/reverse1.arc ${TMPDIR}/reverse2.arc + diff --git a/gpsbabel/testo.d/stackfilter.test b/gpsbabel/testo.d/stackfilter.test new file mode 100644 index 000000000..bc25122c9 --- /dev/null +++ b/gpsbabel/testo.d/stackfilter.test @@ -0,0 +1,9 @@ + +# +# stack filter tests +# These don't actually test for proper behavior, for now, but they do +# exercise all of the currently-extant filter code. +# + +gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt + diff --git a/gpsbabel/testo.d/stmsdf.test b/gpsbabel/testo.d/stmsdf.test new file mode 100644 index 000000000..fa1741149 --- /dev/null +++ b/gpsbabel/testo.d/stmsdf.test @@ -0,0 +1,11 @@ + +# +# Suunto SDF +# +rm -f ${TMPDIR}/stmsdf* +gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -t -o stmsdf -F ${TMPDIR}/stmsdf-track.sdf -r -o stmsdf,index=2 -F ${TMPDIR}/stmsdf-route.sdf +compare ${REFERENCE}/track/stmsdf-track.sdf ${TMPDIR}/stmsdf-track.sdf +compare ${REFERENCE}/route/stmsdf-route.sdf ${TMPDIR}/stmsdf-route.sdf +gpsbabel -i stmsdf -f ${TMPDIR}/stmsdf-track.sdf -f ${TMPDIR}/stmsdf-route.sdf -o garmin_txt,prec=2 -F ${TMPDIR}/stmsdf.txt +compare ${REFERENCE}/stmsdf.txt ${TMPDIR}/stmsdf.txt + diff --git a/gpsbabel/testo.d/tpg.test b/gpsbabel/testo.d/tpg.test new file mode 100644 index 000000000..312ea4626 --- /dev/null +++ b/gpsbabel/testo.d/tpg.test @@ -0,0 +1,11 @@ + +# TPG (NG Topo!) file format +# This is hard to test as the datum conversions create minute +# inconsistencies in the coordinates. So.. we test our i/o +# against a format that rounds higher than we care to compare +# for binary data. +rm -f ${TMPDIR}/topo.mxf ${TMPDIR}/tpg.mxf ${TMPDIR}/geo.tpg +gpsbabel -i geo -f ${REFERENCE}/../geocaching.loc -o tpg -F ${TMPDIR}/geo.tpg +gpsbabel -i tpg -f ${TMPDIR}/geo.tpg -o mxf -F ${TMPDIR}/tpg.mxf +gpsbabel -i tpg -f ${REFERENCE}/tpg.tpg -o mxf -F ${TMPDIR}/topo.mxf +compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf diff --git a/gpsbabel/testo.d/unicsv_grids.test b/gpsbabel/testo.d/unicsv_grids.test new file mode 100644 index 000000000..22e08515d --- /dev/null +++ b/gpsbabel/testo.d/unicsv_grids.test @@ -0,0 +1,17 @@ +# +# unicsv with various grids +# +gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-swiss.csv -o gpx -F ${TMPDIR}/grid-swiss~csv.gpx +compare ${REFERENCE}/grid-swiss~csv.gpx ${TMPDIR}/grid-swiss~csv.gpx +gpsbabel -i gpx -f ${REFERENCE}/grid-swiss~csv.gpx -o unicsv,utc=0,grid=swiss -F ${TMPDIR}/grid-swiss.csv +compare ${REFERENCE}/grid-swiss.csv ${TMPDIR}/grid-swiss.csv + +gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-bng.csv -o gpx -F ${TMPDIR}/grid-bng~csv.gpx +compare ${REFERENCE}/grid-bng~csv.gpx ${TMPDIR}/grid-bng~csv.gpx +gpsbabel -i gpx -f ${REFERENCE}/grid-bng~csv.gpx -o unicsv,utc=0,grid=bng -F ${TMPDIR}/grid-bng.csv +compare ${REFERENCE}/grid-bng.csv ${TMPDIR}/grid-bng.csv + +gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/grid-utm.csv -o gpx -F ${TMPDIR}/grid-utm~csv.gpx +compare ${REFERENCE}/grid-utm~csv.gpx ${TMPDIR}/grid-utm~csv.gpx +gpsbabel -i gpx -f ${REFERENCE}/grid-utm~csv.gpx -o unicsv,utc=0,grid=utm -F ${TMPDIR}/grid-utm.csv +compare ${REFERENCE}/grid-utm.csv ${TMPDIR}/grid-utm.csv diff --git a/gpsbabel/testo.d/xmapwpt.test b/gpsbabel/testo.d/xmapwpt.test new file mode 100644 index 000000000..80fdbb151 --- /dev/null +++ b/gpsbabel/testo.d/xmapwpt.test @@ -0,0 +1,6 @@ + +# XMapHH Street Atlas USA file format +rm -f ${TMPDIR}/xmapwpt.wpt ${TMPDIR}/xmapwpt.xmapwpt +gpsbabel -i xmapwpt -f ${REFERENCE}/xmapwpt.wpt -o xmapwpt -F ${TMPDIR}/xmapwpt.xmapwpt +gpsbabel -i xmapwpt -f ${TMPDIR}/xmapwpt.xmapwpt -o xmapwpt -F ${TMPDIR}/xmapwpt.wpt +compare ${TMPDIR}/xmapwpt.wpt ${REFERENCE} -- 2.30.2